package com.sky.lightleafpicturepavilionserver.util;

import com.sky.lightleafpicturepavilionserver.constant.SystemConfigConstant;
import com.sky.lightleafpicturepavilionserver.service.SystemConfigService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 系统配置工具类
 */
@Component
@RequiredArgsConstructor
public class SystemConfigUtil {

    private final SystemConfigService systemConfigService;

    /**
     * 获取每日签到能量
     */
    public Integer getDailySignEnergy() {
        return systemConfigService.getIntConfigValue(
                SystemConfigConstant.DAILY_SIGN_ENERGY, 5);
    }

    /**
     * 获取下载壁纸消耗能量
     */
    public Integer getWallpaperDownloadEnergyCost() {
        return systemConfigService.getIntConfigValue(
                SystemConfigConstant.WALLPAPER_DOWNLOAD_ENERGY_COST, 1);
    }

    /**
     * 获取热门壁纸浏览量阈值
     */
    public Integer getHotWallpaperViewThreshold() {
        return systemConfigService.getIntConfigValue(
                SystemConfigConstant.HOT_WALLPAPER_VIEW_THRESHOLD, 1000);
    }

    /**
     * 获取热门壁纸点赞量阈值
     */
    public Integer getHotWallpaperLikeThreshold() {
        return systemConfigService.getIntConfigValue(
                SystemConfigConstant.HOT_WALLPAPER_LIKE_THRESHOLD, 100);
    }
}